<template>
  <div>
    <el-timeline>
      <el-timeline-item
        v-for="item in chapters"
        :key="item.id"
        :timestamp="item.timestamp"
        :placement="top"
      >
        <el-card>
          <h4>{{ item.content }}</h4>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { chapter } from '@/api/user'
import { watchSwitchLang } from '@/utils/i18n'

const chapters = ref([])
const getChapterData = async () => {
  chapters.value = await chapter()
}
getChapterData()
watchSwitchLang(getChapterData)
</script>

<style></style>
